<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头函数的参数和返回值</title>
</head>
<body>
    <script>
        //1.1一个参数问题：
        const sum = (num1,num2) =>{
            return num1+num2
        }
        //1.2一个参数
        const power = num =>{
            return num*num
        }

        //2.函数中
        //2.1函数代码中有多行代码
        const test = () =>{
            //1.打印 hello world
            console.log("hello word");

            // 2.打印 hello vue
            console.log("hello vue");
        }
        // 2.2函数代码中只有一行代码
        // const mul = (num1,num2)=>{
        //     return num1 * num2
        // }
        const mul = (num1,num2) => num1 * num2
        console.log(mul(20,30));

        const demo = () =>console.log("hello demo");
        console.log(demo());
    </script>
    
</body>
</html>